﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;

namespace ModeloGaleriaNET
{
    public class TematicasData
    {
        private StringCollection tematicas;

        private TematicasData()
        {
            tematicas = new StringCollection();
            tematicas = Properties.Settings.Default.Tematicas;
        }

        public static readonly TematicasData Instance = new TematicasData();

        public List<string> Tematicas
        {
            get
            {
                List<string> salida = new List<string>();
                if (tematicas != null)
                {
                    foreach (string s in tematicas)
                        salida.Add(s);
                }
                return salida;
            }
        }

        public void Save(List<string> tematicasInput)
        {
            if (tematicas == null)
                tematicas = new StringCollection();
            tematicas.Clear();
            foreach (string s in tematicasInput)
                tematicas.Add(s);
            Properties.Settings.Default.Tematicas = tematicas;
            Properties.Settings.Default.Save();
        }

        public void Clear()
        {
            Save(new List<string>());
        }
    }
}
